package com.gy.def.enums;

import lombok.Getter;

/**
 * 抛出异常的code
 */

/**
 * 1000-2000为系统错误,无需提示用户
 * 2001-3000为业务错误,需要给用户提示（固定code不可更改）
 * 3001-4000为业务错误,需要给用户提示（开发者自定义）
 */
@Getter
public enum ResultEnum {

  FAIL(-1, "失败"),
  SUCCESS(0, "成功"),
  QUERY_ERROR(1000, "查询错误"),
  VERSION_EMPTY(1001, "查询版本号失败"),
  TIME_TRANSFORM_ERROR(1002, "查询错误"),
  ErrorDicCreateFail(1005, "上传失败"),
  KAFKA_PRODUCER_ERROR(1006, "操作失败"),
  OK(200, "成功"),
  ErrorParam(304, "请求数据错误"),
  NotLogin(300, "没有登录"),
  SQLSelectNull(301, "没有查询到所需数据"),
  ErrorEnctype(310, "上传图片的表单中没有定义类型Enctype"),
  ErrorUploadPic(311, "上传图片失败，原因可能有1.文件夹创建失败 2.文件不是图片类型 3.服务器空间已满 请联系管理员"),
  ErrorAccountRepetition(312, "注册账户名重复"),
  ErrorAccountOrPassword(313, "登录失败,账号或密码不正确"),
  ErrorDepartmentNameRepetition(314, "创建失败,部门名称重复"),
  GetSupplierNULL(315, "暂无供应商数据"),
  ErrorWarehouseRepetition(316, "仓库名重复"),
  ErrorSupplierRepetition(317, "供应商名重复"),
  GetWarehouseNULL(318, "暂无仓库数据"),
  GetDepartmentNULL(324, "暂无部门数据"),
  GetUserNULL(319, "暂无用户数据"),
  ErrorOldPassword(320, "旧密码填写错误"),
  ErrorItemNameRepetition(321, "在该仓库已有此物资"),
  ErrorInWarehouseGet(322, "入库仓库获取失败"),
  ErrorInWarehouseGetSupplier(323, "入库供应商获取失败"),
  ErrorUserNotFound(324, "用户未找到"),
  GetItemNULL(325, "暂无物品数据"),
  GetOutWarehouseNULL(326, "未查询到出库仓库"),
  GetOutDepartmentTargetNULL(327, "未查询到目标部门"),
  GetOutItemNULL(328, "未查询到出库物品"),
  ItemCountNoEnough(329, "物品数量不足"),
  GetOutWarehouseHistoryNULL(330, "暂无出库记录"),
  GetDiskNULL(330, "暂无盘损记录"),
  GetUserAccountNULL(331, "未知账户名"),
  ErrorVerifyMailbox(332, "验证邮箱错误"),
  GetMessageNULL(333, "暂无信息"),
  ErrorFileEmpty(334, "上传文件为空"),
  ErrorFileUpFail(335, "上传失败"),
  GetOrderNULL(336, "暂无订单"),
  ErrorCourseRepetition(337, "添加课程名重复"),
  ErrorCourseNull(338, "未找到课程"),
  AlreadyAddCourse(339, "添加课程重复"),
  ErrorGetGradeNULL(340, "未找到成绩"),
  ErrorBookRepetition(341, "书名重复"),
  ErrorGetBookNULL(342, "未找到书籍"),
  ErrorBookStatus(343, "书籍状态错误"),
  ErrorUpdate(500, "数据库更新失败"),
  ErrorInsert(501, "数据库插入失败"),
  ErrorSelect(502, "数据库查询失败"),
  LALALALA(0000, "占位置的"),
  ;

  private Integer code;

  private String message;

  ResultEnum(Integer code, String message) {
    this.code = code;
    this.message = message;
  }

}
